package 
{
import airBattle.AirContext;

import com.bit101.components.HBox;
import com.bit101.components.PushButton;

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.MouseEvent;

public class Main extends Sprite
{
	public function Main()
	{
		stage.align = StageAlign.TOP_LEFT;
		stage.scaleMode = StageScaleMode.NO_SCALE;
		
		init();
	}
	
	private function init():void
	{
		//context
		var context:AirContext = new AirContext();
		
		//ui
		var hBox:HBox = new HBox(this);
		
		var idleBtn:PushButton = new PushButton(hBox);
		idleBtn.label = "idle";
		idleBtn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void
		{
			context.idle();
		});
		
		var moveBtn:PushButton = new PushButton(hBox);
		moveBtn.label = "move";
		moveBtn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void
		{
			context.move();
		});
		
		var deathBtn:PushButton = new PushButton(hBox);
		deathBtn.label = "death";
		deathBtn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void
		{
			context.death();
		});
		
		var attackBtn:PushButton = new PushButton(hBox);
		attackBtn.label = "attack";
		attackBtn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void
		{
			context.attack();
		});
		
		var attackedBtn:PushButton = new PushButton(hBox);
		attackedBtn.label = "attacked";
		attackedBtn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void
		{
			context.attacked();
		});
	}
	
}
}
